package com.example.demo;

import com.example.demo.model.ReadList;
import com.example.demo.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class TestController {

    //yml读取单个值
    @Value("${server.port}")
    private Integer port;
    //读取对象
    @Autowired
    private Student student;

    @Autowired
    private ReadList readList;


    @ResponseBody
    @RequestMapping("/sayhi")  //一级路由
    public String sayHi(){
        return "student "+ student;
    }
}
